home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / games / spassion / source.lzh / SOURCE / PLAYER.H < prev    next >
Text File  |  2000-03-21  |  4KB  |  115 lines

  1. #define PLAYER1                0
  2. #define PLAYER2                1
  3.  
  4. #ifndef PLAYER_X
  5. #define PLAYER_X    (*((short *) (&player->lx)))    /*lxの上位ワード*/
  6. #define PLAYER_Y    (*((short *) (&player->ly)))    /*lyの上位ワード*/
  7. #define CENTER_X            5
  8. #endif
  9.  
  10. #define PLAYER_MIN_X        (16)    /* X 座標最小値 */
  11. #define PLAYER_MAX_X        (16+255-12)
  12. #define PLAYER_MIN_Y        (16+4)    /* Y 座標最小値 */
  13. #define PLAYER_MAX_Y        (16+255-4)
  14.  
  15. /* 当たり判定の範囲 */
  16. #define PLAYER_HIT_X        6
  17. #define PLAYER_HIT_Y        3
  18. #define OPTION_HIT_X        7
  19. #define OPTION_HIT_Y        5
  20. #define CENTER_X            5
  21.  
  22. /*プレイヤーの状態*/
  23. enum {
  24.     PLAYER_ALIVE = 0,    /* プレイヤーは生きている */
  25.     PLAYER_APPEAR,    /* 登場中(画面左から出てくる・操作不能) */
  26.     PLAYER_MUTEKI,    /* 無敵(登場直後) */
  27.     PLAYER_BARRIER,    /* バリアで無敵 */
  28.     PLAYER_DEAD,    /* 死んでいる */
  29.     PLAYER_LAST,    /* オールクリア */
  30.     PLAYER_WAIT        /* 出番待ち */
  31. };
  32.  
  33. enum {
  34.     GAME_PLAY = 0,        /* ゲーム中 */
  35.     GAME_OVER,            /* 死んでゲームオーバー */
  36.     GAME_COMPLETE,        /* オールクリア */
  37. };
  38.  
  39.  
  40. /*オプションの種類*/
  41. enum {DEF=0,ATT,MUTEKI};
  42.  
  43. /* 溜めているときのアニメーション */
  44. typedef struct CHARGE_SP{
  45.     short    x, y;                    /* 座標 */
  46.     short    pt;                        /* スプライトパターンNo. */
  47.     short    info;                    /* 反転コード・色・優先度を表わすデータ */
  48.     short    anim_count;                /* アニメーションカウント */
  49. }CHARGE_SP;
  50.  
  51. /* オプション */
  52. typedef struct OPTION{
  53.     signed short x, y;                /* 座標 */
  54.     short    pt;                        /* スプライトパターンNo. */
  55.     short    info;                    /* 反転コード・色・優先度を表わすデータ */
  56.     signed int lx, ly;                /* 32bit X,Y 座標 ( l = longword ) */
  57.     signed int vx, vy;                /* 速度 */
  58.     short    rx, ry;                    /* 当たり判定の範囲 */
  59.     short    type;                    /* オプションの種類 */
  60.     short    charge;                    /* エネルギーチャージ数 */
  61.     short    shot_count;                /* 連射カウンタ ( 0 だと撃てる ) */
  62.     short    anim_count;                /* アニメーションカウント */
  63.     CHARGE_SP    charge_sp;            /* 溜めてるときのアニメーション用 */
  64. }OPTION;
  65.  
  66. typedef struct PLAYER{
  67.     signed short x, y;                /* 座標 */
  68.     short    pt;                        /* スプライトパターンNo. */
  69.     short    info;                    /* 反転コード・色・優先度を表わすデータ */
  70.     signed int lx, ly;                /* 32bit X,Y 座標 ( l = longword ) */
  71.     signed int vx, vy;                /* 速度 */
  72.     short    hit_x, hit_y;            /* 当たり判定の範囲 */
  73.     int    old_lx[256], old_ly[256];    /* 前回の32bit X,Y 座標 ( l = longword ) */
  74.     short    gx, gy;                    /* 目標値 */
  75.  
  76.     short    num;                    /* プレイヤーの番号 */
  77.     short    left;                    /* 残機数 */
  78.     short    state;                    /* プレイヤーの状態 */
  79.     short    pow_lev;                /* パワーアップレベル */
  80.     short    shot_type;                /* ショットの種類 */
  81.     short    charge;                    /* エネルギーチャージ数 */
  82.     short    dir;                    /* 自機の向いている方向 */
  83.     short    dead_count;                /* 死ぬときのカウンタ ( 0 だと生きている ) */
  84.     short    muteki_count;            /* 復活後の無敵カウンタ ( 0 だと通常 ) */
  85.     short    flash_count;            /* 無敵時のパレットフラッシュ用カウンター */
  86.     short    laser[2];                /* レーザーは出てるか(0だと出てない) */
  87.     short    shot_count;                /* 連射カウンタ ( 0 だと撃てる ) */
  88.     short    a_button_flag;            /* A ボタンフラグ */
  89.     short    b_button_flag;            /* B ボタンフラグ */
  90.     char    old_joy;                /* 前のジョイスティック状態 */
  91.     char    button_swap;            /* ボタンを入れ換えてるか */
  92.     short    pointer;                /* old_lx,old_lyの要素(オプション用) */
  93.     short    score;                    /* 点数 */
  94.     OPTION    option[10];                /* オプション */
  95.     short    option_type;            /* オプションの種類 */
  96.     short    option_charge;            /* エネルギーチャージ数 */
  97.     short    option_anim_count;        /* アニメーションカウント */
  98.     CHARGE_SP    charge_sp;            /* 溜めてるときのアニメーション用 */
  99. }PLAYER;
  100.  
  101. #ifdef GLOBAL_DEFINE        /* グローバル変数の定義と宣言を1つにまとめるテク */
  102. #define Extern            /* Extern をヌル文字列に置換 */
  103. #else
  104. #define Extern extern        /* Extern を extern に置換 */
  105. #endif
  106.  
  107.  
  108. /* グローバル変数 */
  109. Extern PLAYER player[2];
  110. Extern PLAYER left[2];
  111. Extern short    game_over_state;
  112.  
  113. void    InitPlayer( PLAYER * );
  114. void    MovePlayer( PLAYER * );
  115.